package com.xqls.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xqls.dal.dao.UserRoleDao;
import com.xqls.dal.model.UserRoleExample;
import com.xqls.dal.model.UserRoleKey;
import com.xqls.dal.service.UserRoleMapper;

@Repository
public class UserRoleKeyDaoImpl implements UserRoleDao {

	@Autowired private UserRoleMapper userRoleMapper; 
	
	@Override
	public boolean insertDate(UserRoleKey useRoleKey) {
		boolean result=false;
		if(this.userRoleMapper.insert(useRoleKey)>0)
		{
			result=true;
		}
		return result;
	}

	@Override
	public boolean updateData(UserRoleKey useRoleKey,UserRoleExample example) {
		boolean result=false;
		if(this.userRoleMapper.updateByExample(useRoleKey, example)>0)
		{
			result=true;
		}
		return result;
	}

	@Override
	public boolean deleteData(UserRoleKey userRoleKey) {
		boolean result=false;
		if(this.userRoleMapper.deleteByPrimaryKey(userRoleKey)>0)
		{
			result=true;
		}
		return result;
	}

	@Override
	public boolean deleteDataByExample(UserRoleExample example) {
		boolean result=false;
		if(this.userRoleMapper.deleteByExample(example)>0)
		{
			result=true;
		}
		return result;
	}
	
	@Override
	public List<UserRoleKey> getListByExample(UserRoleExample example) {
		return this.userRoleMapper.selectByExample(example);
	}
	
	@Override
	public UserRoleKey getLastRecord() {
		return this.userRoleMapper.getLastRecord();
	}
	
	
	@Override
	public List<Map<String, Object>> getListByMap(Map<String, Object> map) {
		return this.userRoleMapper.getListByMap(map);
	}
}
